<!doctype html>
<html lang="zh-CH">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>央票通</title>
	<link rel="stylesheet" href="./resource/css/index.css">
	<link rel="stylesheet" href="./resource/css/user.css">
</head>
<body>
<!-- 头部 -->
@include('common.index_head')
<!-- 个人中心 -->
<div class="cont-user">
	<!-- 个人中心头部 -->
	@include('common.user_head')

	<div class="user-center">
		<div class="main">
			<!-- 个人中心列表 -->
			@include('common.user_left')
			
			<div class="user-container left" id="list">
				<div class="user-title user-bank">
					<div class="title">
						<div class="h left">银行卡管理</div>
					</div>
					<div class="user-box">
						<div class="user-bor user-add">
							<div class="btn-b"><a href="/user_bankcard_add"></a></div>
							<span>添加银行卡</span>
						</div>
						@if(!empty($info))
							@foreach($info as $k=>$v)
							<div class="user-bor user-cade">
								<div class="bank-title">
									<img src="{{$v->img}}" alt="">
								</div>
								<div class="user-mess">
									<div class="span left">已绑定</div>
									<div class="left cade">{{substr_replace($v->bank_num,'********',4,11)}}</div>
									<div class="span left clear">{{$v->bound_name}}</div>
									<div class="left">绑定于 ： <span>{{date('Y-m-d',$v->created)}}</span></div>
								</div>
								<a href="javascript:;" class="delete"  data-bank_id="{{$v->bank_id}}">删除</a>
							</div>
							@endforeach
						@endif
					</div>
				</div>
			</div>
		</div>
	</div>
</div>



<!-- footer -->
@include('common.index_foot')
<script src="./resource/js//jquery-1.11.3.min.js"></script>
<script src="./resource/js//index.js"></script>
<script src="./resource/js/user.js"></script>
<!-- Datatables -->
<script src="resource/js/jquery.dataTables.js"></script>
<script src="resource/js/J_main.js"></script>
<script src="resource/js/T.js"></script>
<script type="text/javascript">
	$(document).delegate('.delete','click',function(){
		var data = $(this).data();
		var msg = "您真的确定要删除吗？";
		if (confirm(msg)==true) {
			T.restPost('/user_bankcard_unbound', data, function (response) {
				//console.log(response);
				if (response.data.state) {
					T.ajaxLoad('/bankcard_unbound_ajax', 'list', function () {
					});
				}else {
					alert('删除失败');
				}
			});
		}
	});
</script>
</body>
</html>